package com.sixteen.ordering_system.controller;


import com.sixteen.ordering_system.mapper.DishOrderMiddleMapper;
import com.sixteen.ordering_system.pojo.Dish;
import com.sixteen.ordering_system.pojo.DishOrderMiddle;
import com.sixteen.ordering_system.pojo.SysOrder;
import com.sixteen.ordering_system.pojo.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author sixteen
 * @since 2022-09-16
 */
@Controller
public class DishOrderMiddleController {

    @Autowired
    private DishOrderMiddleMapper dishOrderMiddleMapper;
    @RequestMapping("addUserOrder")
    public String addUserOrder(HttpSession session, Integer dishId, Dish dish){
//        DishOrderMiddle dishOrderMiddle = new DishOrderMiddle();
//        dish.setDishId(dishId);
//        dishOrderMiddle.setDish(dish);
//        SysUser sysUser = (SysUser) session.getAttribute("loginUser");
//        dishOrderMiddle.
//        dishOrderMiddle.setRemark("abcd");
//        dishOrderMiddleMapper.insertMiddle(dishOrderMiddle);
//        if (integer > 0){
//            return "/ordering";
//        }
        return "redirect:/ordering";

    }

}
